﻿<UserControl x:Class="Kaskelot.SP.UI.Analys.Controls.CheckboxFieldPicker"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewModels="clr-namespace:Kaskelot.SP.UI.Analys.ViewModel;assembly=Kaskelot.SP.UI.Analys.Data"
    mc:Ignorable="d"
    d:DataContext="{d:DesignInstance Type=viewModels:Entity, IsDesignTimeCreatable=False}"
    d:DesignHeight="300" d:DesignWidth="400">
    
    <Grid x:Name="LayoutRoot">
        <StackPanel Orientation="Vertical">
            <StackPanel x:Name="EntityTitlePanel" Orientation="Horizontal" Margin="5,0,0,0">
                <CheckBox x:Name="EntitySelectionCheckbox" IsChecked="{Binding Path=Checked, Mode=TwoWay}" />
                <TextBlock VerticalAlignment="Center" Margin="0,0,10,0" Text="{Binding Path=Name}" Style="{StaticResource EntityListHeading}" />
            </StackPanel>
            <ListBox x:Name="PrimaryEntityFieldList" ItemsSource="{Binding Path=Fields}" Style="{StaticResource QueryBuilderList}" IsEnabled="{Binding Checked}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <CheckBox IsChecked="{Binding Path=Checked, Mode=TwoWay}" />
                            <TextBlock Text="{Binding Path=NameInQueryBuilder}" />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </StackPanel>
    </Grid>
</UserControl>
